home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
doors_2
/
twrogue.zip
/
THIEF.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-04-12
|
4KB
|
104 lines
REM ********************************************************************
REM * *
REM * Thief : a TRADEWARS 2002 v 1.3 utility for evil players *
REM * *
REM * Khalil E. Abu-Saba *
REM * 4/12/92 *
REM * Soquel BBS 408-462-6329 *
REM * *
REM ********************************************************************
DIM robbed(1000), busted(1000), daterob$(1000, 2)
REM **** robbed(n) is listed of sectors robbed
REM **** busted(n) is list of sectors that have busted you
REM **** daterob(n,1)=last date robbed; (n,2)=last date busted
REM **** Robbed.CSV is an ASCII file; each line has a sector number, followed
REM **** by a comma, followed by the last date robbed
REM ****
REM **** Busted.CSV is an ASCII file; each line has a sector number, followed
REM **** by a comma, followed by the last date you were busted there.
REM ****
REM **** Shiplog.csv keeps track of docking logs from all your ports of call
REM **** Each line has the following items, separated by commas:
REM **** Date of docking; time of docking, sector number, docking log
REM **** The docking log is in the original text, i.e. "Frogface docked here
REM **** 4 days ago"
OPEN "robbed.csv" FOR INPUT AS 1
WHILE NOT EOF(1)
INPUT #1, r
robbed(r) = 1
INPUT #1, daterob$(r, 1)
WEND
CLOSE 1
OPEN "busted.csv" FOR INPUT AS 1
WHILE NOT EOF(1)
INPUT #1, b, daterob$(b, 2)
busted(b) = 1
WEND
CLOSE 1
INPUT "name of log file?"; n$
OPEN n$ FOR INPUT AS 1
OPEN "shiplog.csv" FOR APPEND AS 3
sec = 0
WHILE NOT EOF(1)
LINE INPUT #1, l$
REM ************* New Sector Information ***************************
IF INSTR(l$, "Sector : ") = 1 THEN
l1$ = RIGHT$(l$, LEN(l$) - 10)
s = VAL(LEFT$(l1$, INSTR(l1$, " ")))
hit = 0
WHILE hit = 0
LINE INPUT #1, l$
IF INSTR(l$, "Warps to Sector") = 1 THEN
hit = 1
sec = s
END IF
IF LEN(l$) = 0 THEN
hit = 1
END IF
WEND
END IF
REM **************** upadate dat$ and tim$
IF INSTR(l$, "Commerce report") = 1 THEN
colon = INSTR(l$, ":")
dat$ = MID$(l$, colon + 1, 9)
tim$ = MID$(l$, colon + 10, 11)
END IF
REM **************** extract recent player activities **********
IF INSTR(l$, "docked") > 0 THEN
PRINT #3, dat$; ","; tim$; ","; s; ","; l$
END IF
REM ******************* Ports Robbed *****************
IF INSTR(l$, "Success!") > 0 THEN
robbed(sec) = 1
daterob$(sec, 1) = dat$
END IF
REM ****************** Ports Busted ******************
IF INSTR(l$, "Busted!") > 0 THEN
busted(sec) = 1
daterob$(sec, 2) = dat$
END IF
WEND
CLOSE 1
CLOSE 3
OPEN "robbed.csv" FOR OUTPUT AS 2
OPEN "busted.csv" FOR OUTPUT AS 3
FOR i = 1 TO 1000
IF robbed(i) > 0 THEN PRINT #2, i; ","; daterob$(i, 1)
IF busted(i) > 0 THEN PRINT #3, i; ","; daterob$(i, 2)
NEXT i
CLOSE 2
CLOSE 3